﻿using Microsoft.Extensions.DependencyInjection;
using MiddlewareTest.Middleware;
using MiddlewareTest.MiddlewareDelegate;
using MiddlewareTest.TestClass;
using System;
using System.Collections.Generic;
using System.Text;

namespace MiddlewareTest.CustomMiddlewares
{
    public class Test1Middleware : BaseMiddleware
    {
        public Test1Middleware(IServiceProvider serviceProvider)
            :base(serviceProvider)
        {
        }

        public override void Executed(RequestContext context)
        {
            var input = this._serviceProvider.GetRequiredService<InputClass>();
            Console.WriteLine(input.OutputString); 
            Console.WriteLine("Return Test1Middleware");
        }

        public override void Execution(RequestContext context)
        {
            Console.WriteLine("Access Test1Middleware");
        }

    }
}
